export const initFormData = () => {
  const defaultForm = {
    "context": "",
    "fileCode": "",
    "id": "",
    "status": 0,
    "title": "",
    "type": 1,
    "fileContext": ""
  };
  return defaultForm;
};
export const createFormData = (form, uploadData, labelUploadData) => {
  form.fileContext = uploadData.length > 0 ? uploadData.map(v => v.response.data.id).join(",") : "";
  form.fileCode = labelUploadData.length > 0 ? labelUploadData.map(v => v.response.data.id).join(",") : "";
  return form;
};
export const createFileList = (status, list) => {
  let statusArr = ["update"];
  if (statusArr.includes(status)) {
    if (Array.isArray(list) && list.length > 0) {
      return list.map(v => {
        v.name = v.original;
        if (!v.response) {
          v.response = {};
        }
        v.response.data = v;
        return v;
      });
    }
  }
  return [];
};